import { cached } from '@/utils'
import { getEnumDict, ENUM_MAP } from './enumDict'

export const auditState = {
  AUDIT: '0', // 待审核
  AGREE: '1', // 同意
  REFUSE: '9' // 拒绝
}

export async function getAuditStatus() {
  const { data } = await getEnumDict(ENUM_MAP.auditStatus)
  return data
}

const tags = {
  0: 'warning',
  1: 'success',
  9: 'danger'
}
export const auditStatusTag = cached((val) => tags[val])

